#ifndef DRAWING_BOARD_H
#define DRAWING_BOARD_H
#include <QLabel>
#include <QString>
#include <QColor>
#include <QMouseEvent>
#include <QPainter>
#include <QPoint>
class DrawBoard : public QLabel
{
    Q_OBJECT

public:
    explicit DrawBoard(QWidget *parent = 0);
    ~DrawBoard();
public:
    void initWithImage(QString imgName);
    void initWithColor(QColor color);

    void mouseMoveEvent(QMouseEvent *event)   ;
    void mousePressEvent(QMouseEvent *event)  ;
    void mouseReleaseEvent(QMouseEvent *event);
private:
    QImage m_qimg;

    QImage m_showImage;
    QPixmap m_showPixmap;

    bool m_bMouseDown;
    QPainter m_painter;
    QPoint m_startPoint;
    QPoint m_endPoint;
};
#endif // DRAWING_BOARD_H
